import request from '@/request'
import {C2B} from '@/utils/wordtransfer.js'

// 查询搜索并分页
export const findPages = (data) => {
    return request.post("/searchkeywords/list",data)
}

// 回收站
export const findsRecyle = (data) => {
    return request.post("/searchkeywords/recyle",data)
}

// 保存和更新
export const saveUpdate = (data) => {
    return request.post("/searchkeywords/saveupdate",data)
}

// 根据id查询
export const getById = (id) => {
    return request.post(`/searchkeywords/get/${id}`,{})
}

// 根据id删除 --逻辑删除
export const deleteById = (id) => {
    return request.post(`/searchkeywords/del/${id}`,{})
}

// 恢复删除
export const recoverById = (id) => {
    return request.post(`/searchkeywords/recover/${id}`,{})
}

// 批量逻辑删除
export const bacthDeletes = (ids) => {
    return request.post(`/searchkeywords/batch/dels`,{ids})
}

// 批量恢复
export const batchRecovers = (ids) => {
    return request.post(`/searchkeywords/batch/recover`,{ids})
}

// 根据id删除 --逻辑删除
export const removeById = (id) => {
    return request.post(`/searchkeywords/remove/${id}`,{})
}

// 批量物理删除
export const batchRemoves = (ids) => {
    return request.post(`/searchkeywords/batch/remove`,{ids})
}

// 修改状态
export const updateStatus = (id,field,value) => {
    field = C2B(field)
    return request.post(`/searchkeywords/status/${id}/${field}?value=${value}`,{})
}